local LoadingLayer = class("BuffLayer", require "widget/BaseUI")
 
function LoadingLayer.create()
  local layer = LoadingLayer.new()
  layer:init( )
  return layer
end

function LoadingLayer:init()
    self.m_Json = ccs.GUIReader:getInstance():widgetFromJsonFile("image/ui/Json/LayerLoad.json")
    self.m_Json:setPositionX(-WinSize.width/2)
    self.m_Json:setPositionY(-WinSize.height/2) 
    local WinSize = cc.Director:getInstance():getWinSize()
    self.m_Json:setScaleX(WinSize.width/self.m_Json:getContentSize().width)
    self.m_Json:setScaleY(WinSize.height/self.m_Json:getContentSize().height)
    self:addChild(self.m_Json)
    
    self.m_BtnSet = self.m_Json:getChildByName("Load_bt_set")
    self.m_BtnSet:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
    
    self.m_BtnRegister = self.m_Json:getChildByName("Load_bt_register")
    self.m_BtnRegister:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
    
    self.m_BtnQuick = self.m_Json:getChildByName("load_bt_quick")
    self.m_BtnQuick:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
    
    self.m_BtnLoad = self.m_Json:getChildByName("load_bt_load")
    self.m_BtnLoad:addTouchEventListener(function(sender,eventType)self:onMenutClick(sender,eventType) end)
    
    self.m_TextFieldPassword = self.m_Json:getChildByName("Password_Text")
    self.m_ImageViewPasswordBg = self.m_Json:getChildByName("Load_Password_Edit")
    self.m_ImageViewAccountsBg = self.m_Json:getChildByName("Load_Accounts_Edit")
    self.m_ImageViewBg = self.m_Json:getChildByName("load_bg")
    self.m_Panel = self.m_Json:getChildByName("Panel")
  
end


function LoadingLayer:onMenutClick(sender,eventType)
    if eventType == ccui.TouchEventType.ended then
        if sender == self.m_BtnSet then     
            print "=========BuffLayer:onMenutClick m_BtnSet======================="
        elseif sender == self.m_BtnRegister then     
            print "=========BuffLayer:onMenutClick m_BtnRegister======================="
        elseif sender == self.m_BtnQuick then     
            print "=========BuffLayer:onMenutClick m_BtnQuick======================="
        elseif sender == self.m_BtnLoad then     
            print "=========BuffLayer:onMenutClick m_BtnLoad======================="
        end
    end
end
 
return LoadingLayer